<?php
/**
 * Created by PhpStorm.
 * User: cxj
 * Date: 16/12/30
 * Time: 下午2:50
 */
namespace app\assets;

use yii\web\AssetBundle;

class PublishAsset extends AssetBundle
{
    public $basePath = '@webroot';
    public $baseUrl = '@web';
    public $css = [
        "/css/home.css",
        "/css/publish.css",
        'publish/css/umeditor.css',
        'css/bootstrap.min.css'
    ];
    public $js = [
//        'js/jquery.min.js',
        'publish/third-party/jquery.min.js',
        '/publish/umeditor.config.js',
        '/publish/umeditor.min.js',
        '/publish/zh-cn.js',
        'js/bootstrap.min.js',
    ];
    public $depends = [
        'yii\web\YiiAsset',
        'yii\bootstrap\BootstrapAsset',
    ];

    //定义按需加载JS方法，注意加载顺序在最后
    public static function addScript($view, $jsfile) {
        $view->registerJsFile($jsfile, [AppAsset::className(), 'position'=> \yii\web\View::POS_HEAD,"depends" => "app\\assets\\AppAsset"]);
    }
    //定义按需加载css方法，注意加载顺序在最后
    public static function addCss($view, $cssfile) {
        $view->registerCssFile($cssfile, [AppAsset::className(), "depends" => "app\\assets\\AppAsset"]);
    }
}